﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VOL.Entity.DomainModels.ProductionManagement;
using VOL.Smartmanufacturing.Infrastructure;
using VOL.Smartmanufacturing.IServices.ProductionManagement;

namespace VOL.Smartmanufacturing.Services.ProductionManagement
{
    /// <summary>
    /// 添加设备台账
    /// </summary>
    public class AddEquipmentLedger : IAddEquipmentLedger
    {
        private readonly IBaseRepository<EquipmentLedgerModel> _equipmentLedgerRep;
        /// <summary>
        /// 添加设备台账
        /// </summary>
        /// <param name="equipmentLedgerRep">设备台账实体</param>
        public AddEquipmentLedger(IBaseRepository<EquipmentLedgerModel> equipmentLedgerRep)
        {
            _equipmentLedgerRep = equipmentLedgerRep;
        }

        /// <summary>
        /// 添加设备台账
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public async Task<int> AddEquipmentLedgerAsync(EquipmentLedgerModel model)
        {
            var result = await _equipmentLedgerRep.AddAsync(model);
            return result;
        }
    }
}
